<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>修改对象和修改变量</title>
    <script type="text/javascript">
        let obj = {
            name:"Lisa",
            age:18
        }

        //修改对象,obj对象和obj2对象会同时改变属性名或属性值
        let obj2 = obj
        obj2.name = "Mike"

        //修改变量，obj3={}或=null后，分配了新的内存地址，只有obj3会改变，obj不变
        let obj3 = obj
        obj3 = {}
        obj3.name = "ZhuDi"

        //不想obj4被随意赋值可用const定义，则只能初始化一次
        const obj4 = {
            name:"super",
            age:32
        }
        let obj5 = obj4;
        obj5 = null;
        obj5.name = "monster"
    </script>
</head>
<body>
    
</body>
</html>